{{template "header.html" .}}
<div class="container" id="category-list-container">
    <div id="category-list-header" class="clear">
        <h1 class="h1 left">分类</h1>
        <button class="btn save right" id="category-list-edit-btn">创建分类</button>
    </div>
    <div id="category-list">{{range .Categories}}
        <div class="category-list-item clear">
            <div class="left">
                <h3 class="h3"><a href="/admin/categories/edit/{{.id}}/">{{.title}}</a></h3>
                <p class="slug">{{.slug}}</p>
            </div>
            <div class="left desc">{{.desc}}</div>
            <span class="num right">{{.articles}} 篇文章</span>
        </div>{{end}}
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        $('#category-list-edit-btn').on("click", function () {
            window.location.href = "/admin/categories/add";
        });
    });
</script>
</body>
</html>